from django.shortcuts import render
from django.http import HttpResponse
from .models import Student
# Create your views here.
def index(request):
    c = Student.objects.filter(name='刘泳霖',number='201727010310').count()
    if c == 0:
        new_instance = Student(name='刘泳霖',number='201727010310')
        new_instance.save()
    student = Student.objects.get(number='201727010310')
    ret = "姓名： {}  , 学号: {} ".format(student.name,student.number)
    return HttpResponse(ret)